package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.sys.modular.system.entity.MouldBoardMsg;
import cn.stylefeng.guns.sys.modular.system.service.MouldBoardMsgService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("/mouldBoardMsg")
public class MouldBoardMsgController extends BaseController {
    private String PREFIX = "/modular/system/project/";

    @Autowired
    private MouldBoardMsgService mouldBoardMsgService;

    /**
     * 新增内容
     *
     * @author fengshuonan
     * @Date 2018/12/23 4:57 PM
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public ResponseData add(@RequestBody String mouldBoardMsg) {
        System.out.println(mouldBoardMsg);
        List<MouldBoardMsg> list = JSON.parseArray(mouldBoardMsg, MouldBoardMsg.class);
        boolean save = this.mouldBoardMsgService.addMouldBoardMsg(list);
        return SUCCESS_TIP;
    }
}
